/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package main.java.cn.webrx;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>Project: jse2204 - ObjectStreamDemo
 * <p>Powered by webrx On 2022-09-23 14:11:39
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class ObjectStreamDemo {
    public static void main(String[] args) {
        try(ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("user.dat"))) {
            Date d = new Date();
            oos.writeObject(d);

            List<String> list = new ArrayList<>();
            Student st = new Student();
            list.add("李四");
            oos.writeObject(list);
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }


    static class Student {

    }

}
